//i18n 首页
$(function(){
	home_index.run();
});

var home_index = {
		run: function(){
			this._init_();
			this._start_();
			this._init_events();				
		},
		
		_init_: function(){						
		},
		
		_start_: function(){				
			this._set_cookies();
		},		
		
		_set_cookies: function(){
			/*
			$.cookie("hl", "I18N", {
				expires: 360 * 24 * 3600
			});					
			if(this.ref){
				$.cookie("ref", this.ref, {
					expires: 360 * 24 * 3600
				});	
			}
			*/
		}, 	
		
		_init_events: function(){			
			$("#content_div > div.ghm_box > div.img").bind({
				mouseenter:function(){
					$(this).children('div.tc_btn').fadeIn("slow");
				},
				mouseleave:function(){
					$(this).children('div.tc_btn').stop(true,false).fadeOut("fast");
				}
			});		
			
			$("#gh_seaderBox").smenu({
				defaultValue : 'Search for Videos...',
				onchange : function(value) {
					home_index._search_video(value);
				},
				selectedClass : 'curr'
			});
			
			$("#gh_footer > div.gh_fNav > span.change_ver").click(function(){
				$("#gh_footer > div.gh_fNav > span.change_ver > ul").toggle();
			});
			$("#gh_footer > div.gh_fNav > span.change_ver").mouseover(function(){
				$("#gh_footer > div.gh_fNav > span.change_ver").css("cursor","pointer");
			});
		},
		
		_search_video: function(query){			
			query = encodeURIComponent(query);
			if (query) {
				location.href = main.contextPath + "/world/results?search=" + query;
			}
		}
};